]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-theme-node: Don't hold a ref to the theme context or the theme
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 24 Jun 2012 06:26:39 +0000 (02:26 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 24 Jun 2012 23:20:47 +0000 (19:20 -0400)
This would just be a circular reference, which we need to avoid.

https://bugzilla.gnome.org/show_bug.cgi?id=678737

src/st/st-theme-node.c

index 765a3ee66c449324076733a6a581c7a76e7dc318..27a59f142bd0127d31b4a8ee0a6e2896c6d1875e 100644 (file)
@@ -67,18 +67,6 @@ st_theme_node_dispose (GObject *gobject)
 {
   StThemeNode *node = ST_THEME_NODE (gobject);
 
-  if (node->context)
-    {
-      g_object_unref (node->context);
-      node->context = NULL;
-    }
-
-  if (node->theme)
-    {
-      g_object_unref (node->theme);
-      node->theme = NULL;
-    }
-
   if (node->parent_node)
     {
       g_object_unref (node->parent_node);
@@ -194,7 +182,7 @@ st_theme_node_new (StThemeContext    *context,
 
   node = g_object_new (ST_TYPE_THEME_NODE, NULL);
 
-  node->context = g_object_ref (context);
+  node->context = context;
   if (parent_node != NULL)
     node->parent_node = g_object_ref (parent_node);
   else
@@ -204,7 +192,7 @@ st_theme_node_new (StThemeContext    *context,
     theme = parent_node->theme;
 
   if (theme != NULL)
-    node->theme = g_object_ref (theme);
+    node->theme = theme;
 
   node->element_type = element_type;
   node->element_id = g_strdup (element_id);